version: '3'

volumes:
  pg_data:
  static:
  media:

services:
  db:
    image: postgres:13
    env_file: .env
    volumes:
      - pg_data:/var/lib/postgresql/data
  backend:
    build: ./backend/
    env_file: .env
    volumes:
      - static:/static
      - media:/media
    depends_on:
      - db
  frontend:
    env_file: .env
    build: ./frontend/
    command: cp -r /app/build/. /static/
    volumes:
      - static:/static
  gateway:
    build: ./nginx/
    env_file: .env
    volumes:
      - static:/static
      - media:/media
    ports:
      - 9000:80
    depends_on:
      - backend
